# -*- coding: utf-8 -*-
import cgi
import datetime
import wsgiref.handlers

from google.appengine.ext import db

import enhancedModel as em

class StatusModel( em.EnhancedModel ):
    __prefix__ = 'Status'
	
    hidden = db.BooleanProperty(required=True)
    critical = db.BooleanProperty(required=True)
    isSuccess = db.BooleanProperty(required=True) # czy ten status oznacza sukces?
	
    description = db.StringProperty()

    @staticmethod
    def show( ident ):
        query = StatusModel.queryLatest( StatusModel, ident )
        return query[0].description

    def isSuccess( ident ):
        query = StatusModel.queryLatest( StatusModel, ident )
        return query[0].isSuccess